//
//  MineTableViewCell.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/5.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "MineTableViewCell.h"

@implementation MineTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    WeakSelf
    self.iconImg = [[UIImageView alloc] init];
    [self.iconImg sizeToFit];
    [self addSubview:_iconImg];
    [_iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).offset(rateWidth(45));
    }];
    
    self.titleLB = [UILabel labelWithText:@"" textColor:mineTextColor fontSize:14];
    [_titleLB sizeToFit];
    [self addSubview:_titleLB];
    [_titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.iconImg.mas_centerX).offset(rateWidth(40));
        make.centerY.equalTo(self);
    }];
    
    self.arrow = [[UIImageView alloc] init];
    _arrow.image = UIImageNamed(@"rightArrow");
    [_arrow sizeToFit];
    [self addSubview:_arrow];
    [_arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-rateWidth(30));
        make.centerY.equalTo(self);
    }];
    
    self.line = [[UIView alloc] init];
    _line.backgroundColor = globalGray;
    [self addSubview:_line];
    [_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.equalTo(self);
        make.left.equalTo(self).offset(rateWidth(25));
        make.height.equalTo(@(rateHeight(2)));
    }];
    
}

@end
